﻿using Orchard.Mvc.Routes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace Mod.DisplayTypes
{
    public class Routes : IRouteProvider
    {
        public void GetRoutes(ICollection<RouteDescriptor> routes)
        {
            foreach (var routeDescriptor in GetRoutes()) routes.Add(routeDescriptor);
        }

        public IEnumerable<RouteDescriptor> GetRoutes()
        {
            return new[]
            {
                new RouteDescriptor {
                    Route = new Route(
                        "Contents/{displayType}/Display/Item/{id}",
                        new RouteValueDictionary {
                                                    {"area", "Mod.DisplayTypes"},
                                                    {"controller", "Display"},
                                                    {"action", "Item"}
                                                },
                        new RouteValueDictionary (),
                        new RouteValueDictionary {
                                                    {"area", "Mod.DisplayTypes"}
                                                },
                        new MvcRouteHandler())
                }
            };
        }
    }
}